﻿@namespace Microsoft.FluentUI.AspNetCore.Components
@using Microsoft.FluentUI.AspNetCore.Components.DesignTokens
@inherits FluentComponentBase

<div class="fluent-menubutton-container">
    <FluentButton @ref="Button" Appearance="Appearance.Accent" Style=@ButtonStyle aria-haspopup="true" aria-expanded="@_visible" @onclick=ToggleMenu @onkeydown=OnKeyDown>
        @Text
        <FluentIcon Value="@(new CoreIcons.Regular.Size24.ChevronDown())" Slot="end" Color="@Color.Fill" />
    </FluentButton>
    <FluentMenu @ref="Menu" aria-labelledby="button" Style="@MenuStyle" @bind-Open=@_visible @onmenuchange=OnMenuChangeAsync>
        @foreach (KeyValuePair<string, string> item in Items)
        {
            <FluentMenuItem Id="@item.Key">@item.Value</FluentMenuItem>
        }
    </FluentMenu>
</div>